﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Wijmo.Master" AutoEventWireup="true" CodeBehind="Paging.aspx.cs" Inherits="ControlExplorer.C1GridView.Paging" %>

<%@ Register Assembly="C1.Web.Wijmo.Controls.3" Namespace="C1.Web.Wijmo.Controls.C1GridView" TagPrefix="wijmo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
    <style type="text/css">
        legend
        {
            background-color: transparent;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager runat="server" ID="ScriptManger1" />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <wijmo:C1GridView ID="C1GridView1" runat="server" DataSourceID="SqlDataSource1"
                AutoGenerateColumns="true" ShowRowHeader="true" AllowPaging="true" PageSize="10" CallbackSettings-Action="All">
            </wijmo:C1GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\C1NWind.mdb;Persist Security Info=True"
        ProviderName="System.Data.OleDb" SelectCommand="SELECT [OrderID], [ShipName], [ShipCity], [ShippedDate] FROM ORDERS">
    </asp:SqlDataSource>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="Description" runat="server">
  <p>
    如果<strong>AllowPaging</strong>属性设置为True则允许分页。
  </p>

  <p>
  以下是有关分页的共同特性：
  </p>
  <ul>
    <li><strong>PageSize</strong> -决定放置在一个页面上的行数。</li>
    <li><strong>PagerSettings</strong> -决定的外观，如位置，寻呼机，（顶部\底部），模式（数字，firstLast）等。</li>
  </ul>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="ControlOptions" runat="server">
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <fieldset>
                <legend>选择分页模式</legend>
                <asp:RadioButtonList ID="RblMode" runat="server" Height="12px" AutoPostBack="True"
                    RepeatDirection="Horizontal" OnSelectedIndexChanged="RblMode_SelectedIndexChanged">
                    <asp:ListItem Value="Numeric" Selected="True">数字</asp:ListItem>
                    <asp:ListItem Value="NumericFirstLast">数字 (第一个 &amp; 最后一个)</asp:ListItem>
                    <asp:ListItem Value="NextPrevious">下一个/前一个</asp:ListItem>
                    <asp:ListItem Value="NextPreviousFirstLast">下一个/前一个 (第一个 &amp; 最后一个)</asp:ListItem>
                </asp:RadioButtonList>
            </fieldset>
            <fieldset>
                <legend>选择位置</legend>
                <asp:RadioButtonList ID="RblPosition" runat="server" Height="12px" AutoPostBack="True"
                    RepeatDirection="Horizontal" OnSelectedIndexChanged="RblPosition_SelectedIndexChanged">
                    <asp:ListItem Value="Top">顶部</asp:ListItem>
                    <asp:ListItem Value="Bottom" Selected="True">底部</asp:ListItem>
                    <asp:ListItem Value="TopAndBottom">顶部和底部</asp:ListItem>
                </asp:RadioButtonList>
            </fieldset>
            <fieldset>
                <legend>设置页面大小</legend>
                <label for="TxtPageSize">页面大小:</label>
                <asp:TextBox ID="TxtPageSize" runat="server" Text="10"></asp:TextBox>
            </fieldset>
            <a href="#" id="c1apply">
                <asp:Button runat="server" ID="btnApply" Text="应用" UseSubmitBehavior="false" OnClick="btnApply_Click" />
            </a>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
